package com.xbs.controller.hitchhiking;
/**
 * 员工修改成功的servlet
 */
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xbs.controller.base.BaseServlet;
import com.xbs.entity.EmployeeEntity;
import com.xbs.service.hitchhiking.EmpAdminService;
@WebServlet("/backstage/xgempsucceed")
public class XgEmpServlet extends BaseServlet{

	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		/**
		 * 根据员工的身份证来修改信息
		 */
		EmpAdminService empadmin = new EmpAdminService();
		
		EmployeeEntity employee = new EmployeeEntity();
		employee.setEmpidcard(req.getParameter("xgsfz"));
		employee.setEmpinput(req.getParameter("xglrr"));
		employee.setEmpname(req.getParameter("xgygxm"));
		employee.setEmprole(req.getParameter("xgjs"));
		employee.setEmpsex(req.getParameter("xgxb"));
		employee.setEmpstatus(req.getParameter("xgzt"));
		employee.setEmpstore(req.getParameter("xgszmd"));
		employee.setEmptel(req.getParameter("xgdh"));
		int row = empadmin.updateEmp(employee);
	
		
		/*forward("admin/basicSetting/llp_employee");*/
		redirect("/backstage/employee");
	}
}
